﻿using System;
using System.Collections.Generic;
using System.Web.Http;
using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
using UmbracoExtending.Dealer.Model.District;

namespace UmbracoExtending.Dealer.Controller
{
    /// <summary>
    /// 前端行政区域控制器
    /// </summary>
    [PluginController("UmbracoDealer")]
    public class FrontendDistrictController : UmbracoApiController
    {

        [HttpGet]
        public List<DistrictSimple> GetProvinces()
        {
            return DealerUtil.GetProvinces();
        }

        /// <summary>
        /// 返回城市列表
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        [HttpGet]
        public List<DistrictSimple> GetCitys(string code)
        {
            return DealerUtil.GetCitys(code);
        }
    }
}
